home *** CD-ROM | disk | FTP | other *** search
/ TPUG - Toronto PET Users Group / TPUG Users Group CD / TPUG Users Group CD.iso / C64 / D-Demos / (c)d2.d64 / sound11.c (.txt) < prev    next >
Commodore BASIC  |  2007-02-04  |  2KB  |  78 lines

  1. 100 PRINT"[147]    [221]    [221]   [221]   "
  2. 110 PRINT"    [221]    [221]   [221]   "
  3. 120 PRINT"    [221]    [221]   [221]   "
  4. 130 PRINT"  [221] [221] [221] [221] [221] [221] [221] [221] [221] [221] [221] [221] "
  5. 140 PRINT" Q[221]W[221]E[221]R[221]T[221]Y[221]U[221]I[221]O[221]P[221]@[221]*[221]^"
  6. 150 PRINT"'SPACE' FOR SOLO OR POLYPHONIC"
  7. 160 PRINT"'F1,F3,F5,F7' OCTAVE SELECTION"
  8. 170 PRINT"'F2,F4,F6,F8' WAVEFORM"
  9. 180 PRINT"HANG ON, SETTING UP FREQUENCY TABLE..."
  10. 190 S=13*4096+1024:DIMF(26):DIMK(255)
  11. 200 FORI=0TO28:POKES+I,0:NEXT
  12. 210 F1=7040:FORI=1TO26:F(27-I)=F1*5.8+30:F1=F1/2^(1/12):NEXT
  13. 220 K$="Q2W3ER5T6Y7UI9O0P@-*\^"
  14. 230 FORI=1TOLEN(K$):K(ASC(MID$(K$,I)))=I:NEXT
  15. 240 PRINT"[145]                                      "
  16. 250 AT=0:DE=0:SU=15:RE=10:SR=SU*16+RE:AD=AT*16+DE:WV=16:W=0:M=1:OC=4:HB=256:Z=0
  17. 260 FORI=0TO2:T=I*7:POKES+5+T,AD:POKES+6+T,SR
  18. 270 POKES+2+T,4000AND255:POKES+3+T,4000/256:NEXT
  19. 280 POKES+24,15
  20. 300 GETA$:IFA$=""THEN300
  21. 310 FR=K(ASC(A$)):IFFR=ZTHEN500
  22. 315 PRINTFR"[157]";:FR=F(FR)/M:T=V*7:CR=S+T+4
  23. 320 POKES+5+T,Z:POKES+6+T,Z
  24. 330 POKECR,8:POKECR,Z
  25. 340 POKES+T,FR-HB*INT(FR/HB)
  26. 350 POKES+1+T,FR/HB
  27. 360 POKES+5+T,AD:POKES+6+T,SR
  28. 370 POKECR,WV+1:FORI=1TO50*AT:NEXT
  29. 375 POKECR,WV
  30. 380 IFP=1THENV=V+1:IFV=3THENV=0
  31. 400 GOTO300
  32. 500 IFA$="[133]"THENM=1:OC=4:GOTO300
  33. 510 IFA$="[134]"THENM=2:OC=3:GOTO300
  34. 520 IFA$="[135]"THENM=4:OC=2:GOTO300
  35. 530 IFA$="[136]"THENM=8:OC=1:GOTO300
  36. 540 IFA$="[137]"THENW=0:WV=16:GOTO300
  37. 550 IFA$="[138]"THENW=1:WV=32:GOTO300
  38. 560 IFA$="[139]"THENW=2:WV=64:GOTO300
  39. 570 IFA$="[140]"THENW=3:WV=128:GOTO300
  40. 580 IFA$=" "THENP=1-P:GOTO300
  41. 585 IFA$="X"THEN10000
  42. 590 IFA$="[147]"THEN200
  43. 600 GOTO300
  44. 800 PRINT"HIT A KEY"
  45. 810 GETA$:IFA$=""THEN810:WAIT FOR A KEY
  46. 820 PRINTA$:RETURN
  47. 9000 DATA20,17,15,17,13,17,12,17,10,17,8,17,6,17,15,13,15,15,13,15,12
  48. 9005 DATA15,10,15,8,15,6,15,5,15,13,12,13,13,12,13,10,13,8,13,6,13,5,13,4,13
  49. 9006 DATA12,10,12,12
  50. 9010 DATA10,12,9,12,7,12,5,12,3,12,1,12
  51. 9020 DATA10,8,10,0
  52. 9600 DATA20,12,8,10,12,15,13,13,17,15,15,20
  53. 9610 DATA19,20,15,12,8,10,12,13,15,17,15,13,12,10,12,8,7,8,10,3
  54. 9620 DATA7,10,13,12,10
  55. 9630 DATA12,8,10,12,15,13,13,17,15,15,20
  56. 9640 DATA19,20,15,12,8,10,12
  57. 9650 DATA5,15,13,12,10,8,3,8,7,8,12,15,20,15,12,8
  58. 9660 DATA12,15,18,15,12,8,12,15,17,13,10
  59. 9670 DATA7,10,13,15,12,8,5,8,12,13,10,7,3,7,10,13,12,10
  60. 9680 DATA8,12,15,20,0
  61. 9700 DATA20,5,10,12,13,17,13,12,13
  62. 9999 DATA-1
  63. 10000 READTE:PRINT
  64. 10005 READA:IFA=ZTHENPRINT:GOTO300
  65. 10006 PRINTA"[157]   [145]"
  66. 10010 IFA=-1THENRESTORE:PRINT:GOTO300
  67. 10015 FR=F(A)/M:T=V*7:CR=S+T+4
  68. 10020 POKES+5+T,Z:POKES+6+T,Z
  69. 10030 POKECR,8:POKECR,Z
  70. 10040 POKES+T,FR-HB*INT(FR/HB)
  71. 10050 POKES+1+T,FR/HB
  72. 10060 POKES+5+T,AD:POKES+6+T,SR
  73. 10070 POKECR,WV+1:FORI=1TO50*AT:NEXT
  74. 10075 POKECR,WV
  75. 10080 IFP=1THENV=V+1:IFV=3THENV=0
  76. 10090 FORI=1TOTE:NEXT
  77. 10100 GOTO10005
  78.